import React, { memo, Component } from 'react'
import { } from '@/api/user'
import { Spin, Tabs  } from 'antd'
import '../../index.css'
import SearchPeople from './searchForPeople'
import {getParam,formatDate,getDateDiff} from '../../utils/tool'
import SearchMessage from './searchMessage'
import ManageTable from './thingLostManage'
const { TabPane } = Tabs;
// import { NotificationOutlined } from '@ant-design/icons';
class schoolIndex extends Component {
  constructor(props) {
    super(props);
    this.state = {
      loading: false,
      type:getParam(this.props.location.search,'type') || 1
    }
  }
  componentDidMount() {

  }
  goToDetail=(url)=>{
    console.log(url.split('&'));
    this.props.history.replace(url)
  }
  render() {
    const { userInfo, classInfo } = this.state
    return (
      <Spin spinning={this.state.loading} size="large">
        <Tabs defaultActiveKey={this.state.type} centered style={{backgroundColor:'rgba(255,255,255,.5)'}}>
        <TabPane tab="找失主" key="1">
          <SearchPeople type={1} goDetail={this.goToDetail}/>
        </TabPane>
        <TabPane tab="找失物" key="2">
          <SearchPeople type={2} goDetail={this.goToDetail}/>
        </TabPane>
        <TabPane tab="与我相关" key="3">
          <SearchMessage type={3} goDetail={this.goToDetail}/>
        </TabPane>
        <TabPane tab="超级工作台" key="4">
          <ManageTable />
        </TabPane>
      </Tabs>
      </Spin>
    )
  }
}
export default memo(schoolIndex)